package utils

import (
	"fmt"
	"strconv"

	"github.com/gogf/gf/util/gconv"
)

// 整数转小数，带两位小数
func Int2Point(n float64) string {
	point, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", n/100), 64)
	return fmt.Sprintf("%.2f", point)
}

func GetPoint(n float64) string {
	point, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", n/1), 64)
	return fmt.Sprintf("%.2f", point)
}

// 小数转整数
func Point2Int(n float64) string {
	return gconv.String(gconv.Int64(n * 100))
}
